package com.xajh.duoduo.eunm.process;

import org.springframework.util.StringUtils;

public enum ProcessEnum {
    //练级
    UP_LEVEL("upLevel", "upLevelProcessor"),
    //加入帮派
    JOIN_FACTION("joinFaction", "joinFactionProcessor"),
    //辎重
    IMPEDIMENTA("impedimenta", "impedimentaProcessor"),
    //换角色
    TRANS_ROLE("transRole", "transRoleProcessor"),
    //换号
    TRANS_ACCOUNT("transAccount", "transAccountProcessor"),
    //江湖话本
    SOCIAL_DRAMA("socialDrama", "socialDramaProcessor"),
    //一日游
    ONE_DAY_TRAVEL("oneDayTravel", "oneDayTravelProcessor");

    private String type;
    private String clazzName;

    ProcessEnum(String type, String clazzName) {
        this.type = type;
        this.clazzName = clazzName;
    }

    public static ProcessEnum getEnumByType(String processType){
        if(StringUtils.isEmpty(processType)){
            throw new IllegalArgumentException("参数不能为空");
        }

        for(ProcessEnum processEnum : ProcessEnum.values()){
            if(processEnum.getType().equalsIgnoreCase(processType)){
                return processEnum;
            }
        }

        throw new IllegalArgumentException("未找到类型："+processType);
    }

    public String getType() {
        return type;
    }

    public String getClazzName() {
        return clazzName;
    }

    public void setClazzName(String clazzName) {
        this.clazzName = clazzName;
    }
}
